package com.itc.bi.dto;

import com.itc.bi.entity.DataSetParameterEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;

@ApiModel(value = "创建数据集")
@Data
public class DataSetCreateDto {

    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "数据集类型 DB数据库表：DB;SQL脚本:SQL;python脚本:PY",required = true)
    @NotBlank(message = "数据集类型不能为空")
    private String type;

    @ApiModelProperty("数据集名称")
    private String name;

    @ApiModelProperty(value = "目录ID",required = true)
    @NotBlank(message = "目录不能为空")
    private Long dtId;

    @ApiModelProperty("数据源ID,DB和sql必填，python选填")
    private Long dsId;

    @ApiModelProperty("表名称列表，类型为DB时必填")
    List<String> tables= new ArrayList<>();

    @ApiModelProperty("脚本 类型为SQL或PY时必填")
    private String code;

    @ApiModelProperty("脚本参数")
    List<DataSetParameterEntity> params= new ArrayList<>();

    @ApiModelProperty("执行频率表达式")
    private String cron;
}
